package com.epi.web.log;

import com.epi.web.log.Impl.Log4j2Logger;
import com.epi.web.log.Impl.LogbackLogger;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.LoggerFactory;

import java.util.logging.*;

/**
 * @author dxy
 * @version 1.0
 */
public class LogDemo {
    private static final Logger julLogger = Logger.getLogger("LogDemo");
    private static final Log jclLogger = LogFactory.getLog(LogDemo.class);
    private static final org.slf4j.Logger slf4jLogger = LoggerFactory.getLogger(LogDemo.class);

    public static void main(String[] args) {
//        facadeTest();
        implTest(args);
    }

    private static void implTest(String[] args) {
        LogbackLogger.main(args);
        System.out.println();
        Log4j2Logger.main(args);
    }

    private static void facadeTest() {
        // TODO Spring生态的 Jcl 被桥接到了 Slf4j 上，如何解决
        julLogger.info("【原生 jul】 " + julLogger.getClass().getName());
        jclLogger.info("【门面 jcl】 " + jclLogger.getClass().getName());
        slf4jLogger.info("【门面 slf4j】 " + slf4jLogger.getClass().getName());
    }
}
